#ifndef SIDEBAR_H
#define SIDEBAR_H

#include <QWidget>
#include<QMouseEvent>
#include<QColor>
#include<QPainter>

class Sidebar : public QWidget
{
    Q_OBJECT
public:
    explicit Sidebar(QWidget *parent = nullptr);
    ~Sidebar();

    void addItem(const QString &iconPath,const QString &title);
    void setWidth(const int &width);
    void setBackgroundColor(const QColor &color);
    void setSelectColor(const QColor &color);
    void setMouseInColor(const QColor &color);
    void setRowHeight(const int &height);
protected:
    void paintEvent(QPaintEvent *);
   void mouseMoveEvent(QMouseEvent *);
   void mousePressEvent(QMouseEvent *);
   void leaveEvent(QEvent *);
private:
    QList<QString> listIcons;
    QList<QString> listItems;
    QColor backgroundColor;
    QColor selectedColor;
    QColor mouseInColor;
    int rowHeight;
    int currentIndex;
    int mouseMoveIndex;


signals:
    void currentItemChanged(const int &index);
};

#endif // SIDEBAR_H
